package io;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

import datamodel.Field;
import datamodel.Grid;

public class XStreamFactory {

	public final static String ROOT = "Sudoku";
	public final static String SIGN = "Sign";

	/**
	 * Creates a XStream object with aliases for the classes
	 * <code>{@link datamodel.Grid}</code> and <code>{@link datamodel.Field}</code>.
	 * Furthermore the tag <code>&#060;grid&#062;</code> is removed.
	 * 
	 * @return Initialized XStream object to serialize Sudokus to XML files
	 */
	public static XStream getXStream() {
		XStream xStream = new XStream(new DomDriver());
		
		xStream.processAnnotations(Grid.class);
		xStream.processAnnotations(Field.class);

		return xStream;
	}
}
